function autoTable(id, data) {
    let tds = $("#"+id+" tbody:first tr:first td");
    let html = '';
    for (let i = 0; i < data.length; i++) {
        html += `<tr>`;
        for (let j = 0; j < tds.length; j++) {
            let $td = $(tds[j])
            if ($td.attr("param1")) {

                if (!$td.attr("param2")) {
                    let mapping = $td.attr("mapping")
                    if (mapping) {
                        let s = mapping.split(",");
                        html += `<td>` + s[data[i][$td.attr("param1")]] + `</td>`;
                    } else {
                        html += `<td>` + data[i][$td.attr("param1")] + `</td>`;
                    }
                } else {
                    if (data[i][$td.attr("param1")] != null) {
                        let mapping = $td.attr("mapping")
                        if (mapping) {
                            let s = mapping.split(",");
                            html += `<td>` + s[data[i][$td.attr("param1")][$td.attr("param2")]] + `</td>`;
                        } else {
                            html += `<td>` + data[i][$td.attr("param1")][$td.attr("param2")] + `</td>`;
                        }
                    } else {
                        html += `<td></td>`;
                    }
                }

            } else if ($td.attr("operation")) {
                let as = $td.children();
                html += `<td>`;
                for (let k = 0; k < as.length; k++) {
                    let $a = $(as[k]);
                    let test = $a.attr("test");
                    let flag = true;
                    if (test) {
                        flag = false;
                        let str = test.split("==");
                        let param = str[0].split(".");
                        let right = str[1].split(",");
                        let left = data[i];
                        for (let l = 0; l < param.length; l++) {
                            left = left[param[l]];
                        }
                        for (let l = 0; l < right.length; l++) {
                            if (left == right[l]) {
                                flag = true;
                                break;
                            }
                        }
                    }
                    if (flag) {
                        let href = $a.attr("href");
                        let fun = $a.attr("fun");
                        let text = $a.text();
                        let clazz = $a.attr("class");
                        let obj = JSON.stringify(data[i]);
                        html += `<a href="`+href+`" class="`+clazz+`" onclick='`+fun+`(`+obj+`)' style="padding: 0 2px;">`+text+`</a>`;
                    }
                }
                html += `</td>`;

            }
        }
        html += `</tr>`
    }
    $("#"+id+" tbody:first").html(html);
    $('.tablelist tbody tr:odd').addClass('odd');
}